package com.fs.book.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 书籍类
 * @author suke
 */
@Data
//属性值为null忽略
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Book {
    private Integer bid;
    private String bname;
    @JsonIgnore  //表示忽略该属性
    private String author;
    private BigDecimal price;
    private BigDecimal currPrice;
    private BigDecimal discount;
    private String press;
    @JsonFormat(pattern="yyyy-MM-dd") //把日期转换为json字符串的格式
    @DateTimeFormat(pattern = "yyyy-MM-dd") //把请求参数的字符串转换日期
    private Date publishtime;  //日期默认是时间戳
    private Integer weight;
    private String cid;
    private Integer star;
    //大图路径
    private String imageW;
    //小图路径
    private String imageB;
    private Integer stock;
    private String bookNo;//商品货号
    private String description;
}












